package com.kelaite.procurement.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;

import com.fasterxml.jackson.annotation.JsonIgnore;

// Generated 2016-3-6 15:13:23 by Hibernate Tools 3.4.0.CR1

/**
 * TCompany generated by hbm2java
 */
@Entity(name = "t_company")
public class TCompany extends TBaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id")
	private Long id;

	@Column(name = "business_id")
	private String businessId;

	@Column(name = "company_name", nullable = false, length = 50)
	private String companyName;

	@Column(name = "business_type")
	private short businessType; // 1：甲方； 2：乙方

	@Column(name = "organization_code", nullable = false, length = 20)
	private String organizationCode;

	@Column(name = "tax_no", length = 20)
	private String taxNo;

	@Column(name = "biz_license_pic", length = 100)
	private String bizLicensePic;

	@Column(name = "org_code_pic", length = 100)
	private String orgCodePic;

	@Column(name = "tax_registration_cert_pic", length = 100)
	private String taxRegistrationCertPic;

	@Column(name = "is_general_taspayer")
	private short isGeneralTaspayer;

	@Column(name = "legal_representative")
	private String legalRepresentative;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = false)
	@JoinColumn(name = "province_id")
	private TProvince tProvince;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = false)
	@JoinColumn(name = "city_id")
	private TCity tCity;

	@Column(name = "address", length = 100)
	private String address;

	@Column(name = "postal_code", length = 10)
	private String postalCode;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = false)
	@JoinColumn(name = "org_type")
	private TOrganizationType tOrganizationType;

	@Column(name = "registered_capital")
	private Long registeredCapital;

	@Column(name = "bank_name", length = 20)
	private String bankName;

	@Column(name = "bank_account", length = 30)
	private String bankAccount;

	@Column(name = "registered_phone", length = 20)
	private String registeredPhone;

	@Column(name = "main_business", length = 250)
	private String mainBusiness;

	@Column(name = "group_id")
	private Long groupId;

	@Column(name = "is_deleted")
	private String isDeleted;

	@Column(name = "description", length = 300)
	private String description;

	@Column(name = "extra_info", length = 250)
	private String extraInfo;

	@Column(name = "branch", length = 250)
	private String branch;

	@OneToMany(mappedBy = "tCompany", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@OrderBy(value = "id ASC")
	@JsonIgnore
	private Set<TPipelineHeader> tPipelines = new HashSet<TPipelineHeader>();

	public TCompany() {

	}

	public Long getId() {

		return id;
	}

	public void setId(Long id) {

		this.id = id;
	}

	public String getBusinessId() {

		return businessId;
	}

	public void setBusinessId(String businessId) {

		this.businessId = businessId;
	}

	public String getCompanyName() {

		return companyName;
	}

	public void setCompanyName(String companyName) {

		this.companyName = companyName;
	}

	public short getBusinessType() {

		return businessType;
	}

	public void setBusinessType(short businessType) {

		this.businessType = businessType;
	}

	public String getOrganizationCode() {

		return organizationCode;
	}

	public void setOrganizationCode(String organizationCode) {

		this.organizationCode = organizationCode;
	}

	public String getTaxNo() {

		return taxNo;
	}

	public void setTaxNo(String taxNo) {

		this.taxNo = taxNo;
	}

	public String getBizLicensePic() {

		return bizLicensePic;
	}

	public void setBizLicensePic(String bizLicensePic) {

		this.bizLicensePic = bizLicensePic;
	}

	public String getOrgCodePic() {

		return orgCodePic;
	}

	public void setOrgCodePic(String orgCodePic) {

		this.orgCodePic = orgCodePic;
	}

	public String getTaxRegistrationCertPic() {

		return taxRegistrationCertPic;
	}

	public void setTaxRegistrationCertPic(String taxRegistrationCertPic) {

		this.taxRegistrationCertPic = taxRegistrationCertPic;
	}

	public short getIsGeneralTaspayer() {

		return isGeneralTaspayer;
	}

	public void setIsGeneralTaspayer(short isGeneralTaspayer) {

		this.isGeneralTaspayer = isGeneralTaspayer;
	}

	public String getLegalRepresentative() {

		return legalRepresentative;
	}

	public void setLegalRepresentative(String legalRepresentative) {

		this.legalRepresentative = legalRepresentative;
	}

	public TProvince gettProvince() {

		return tProvince;
	}

	public void settProvince(TProvince tProvince) {

		this.tProvince = tProvince;
	}

	public TCity gettCity() {

		return tCity;
	}

	public void settCity(TCity tCity) {

		this.tCity = tCity;
	}

	public String getAddress() {

		return address;
	}

	public void setAddress(String address) {

		this.address = address;
	}

	public String getPostalCode() {

		return postalCode;
	}

	public void setPostalCode(String postalCode) {

		this.postalCode = postalCode;
	}

	public TOrganizationType gettOrganizationType() {

		return tOrganizationType;
	}

	public void settOrganizationType(TOrganizationType tOrganizationType) {

		this.tOrganizationType = tOrganizationType;
	}

	public Long getRegisteredCapital() {

		return registeredCapital;
	}

	public void setRegisteredCapital(Long registeredCapital) {

		this.registeredCapital = registeredCapital;
	}

	public String getBankName() {

		return bankName;
	}

	public void setBankName(String bankName) {

		this.bankName = bankName;
	}

	public String getBankAccount() {

		return bankAccount;
	}

	public void setBankAccount(String bankAccount) {

		this.bankAccount = bankAccount;
	}

	public String getRegisteredPhone() {

		return registeredPhone;
	}

	public void setRegisteredPhone(String registeredPhone) {

		this.registeredPhone = registeredPhone;
	}

	public String getMainBusiness() {

		return mainBusiness;
	}

	public void setMainBusiness(String mainBusiness) {

		this.mainBusiness = mainBusiness;
	}

	public Long getGroupId() {

		return groupId;
	}

	public void setGroupId(Long groupId) {

		this.groupId = groupId;
	}

	public String getIsDeleted() {

		return isDeleted;
	}

	public void setIsDeleted(String isDeleted) {

		this.isDeleted = isDeleted;
	}

	public String getDescription() {

		return description;
	}

	public void setDescription(String description) {

		this.description = description;
	}

	public String getExtraInfo() {

		return extraInfo;
	}

	public void setExtraInfo(String extraInfo) {

		this.extraInfo = extraInfo;
	}

	public Set<TPipelineHeader> gettPipelines() {

		return tPipelines;
	}

	public void settPipelines(Set<TPipelineHeader> tPipelines) {

		this.tPipelines = tPipelines;
	}

	public String getBranch() {

		return branch;
	}

	public void setBranch(String branch) {

		this.branch = branch;
	}

}
